﻿using System.Data.Linq.Mapping;
using System.Reflection;
using YawetagLib.Utilities;

namespace YawetagLib.Data.L2Sql
{
    public static class Extensions
    {
        public static bool IsDataContextEntityPrimaryKey(PropertyInfo propertyInfo)
        {
            ColumnAttribute primaryKeyAttribute = propertyInfo.GetFirstAttribute<ColumnAttribute>(true);

            return primaryKeyAttribute != null && primaryKeyAttribute.IsPrimaryKey;
        }
    }
}
